package xyz.syyrjx.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import xyz.syyrjx.filter.LoginFilter;
import xyz.syyrjx.filter.RestrictFilter;

/**
 * @author Mr.Wan
 * @date 2022/10/12 - 22:32
 */
@Configuration
public class SecurityInterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new RestrictFilter()).addPathPatterns("/**");
        registry.addInterceptor(new LoginFilter()).addPathPatterns("/**");
    }
}
